﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->

<title>意见反馈</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 评论管理 <span class="c-gray en">&gt;</span> 意见反馈 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container" id="app">
	<div class="text-c"> 日期范围：
		<input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}' })" id="datemin" class="input-text Wdate" style="width:120px;">
		-
		<input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d' })" id="datemax" class="input-text Wdate" style="width:120px;">
		<input type="text" class="input-text" style="width:250px" placeholder="输入关键词" id="" name="">
		<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜意见</button>
	</div>

	<div class="mt-20">
		<table class="table table-border table-bordered table-hover table-bg table-sort">
			<thead>
				<tr class="text-c">

					<th width="60">用户名</th>
					<th width="200">反馈建议</th>
					<th width="200">回复情况</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="text-c" v-for="(item, index) in list">
					<td>
						<a href="javascript:;" onclick="member_show('傻逼','member-show.html','10001','360','400')"><i class="avatar size-L radius"><img alt="" src="static/h-ui/images/ucnter/avatar-default-S.gif"></i></a>
					</td>
					<td class="text-l">
						<div class="c-999 f-12">
							<u style="cursor:pointer" class="text-primary" onclick="member_show('傻逼','member-show.html','10001','360','400')">
								{{item.handler.name}}
							</u> 
							<time title="2014年8月31日 下午3:20" datetime="2014-08-31T03:54:20">
								{{item.createdAt | date}}
							</time>
						</div>
						<div>{{item.content}}</div>
					</td>
					<td>
						<input class="input-text" type="text" v-model="item.reply" placeholder="请输入回复内容">
					</td>
					<td class="td-manage">
						<a class="btn" @click="replySuggest(index)" v-show="item.status == 0" title="回复" href="javascript:;"  style="text-decoration:none">回复</a>
					</td>
				</tr>
				
			</tbody>
		</table>
		<div class="handler mt-20">
			<button class="btn" @click="getList(-1)" v-show="page > 1">上一页</button>
			<button class="btn" @click="getList(1)" v-show="list.length == limit">下一页</button>
		</div>
	</div>

</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>  
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> 
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<!-- <script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>  -->
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script src="lib/vue/vue.min.js"></script>
<script src="lib/vue/vue-resource.min.js"></script>
<script src="assets/vue-filter.js"></script>
<script type="text/javascript">


Vue.use(VueResource)

new Vue({
	el: '#app',
	data: {
		list: [],
		page: 1,
		limit: 10
	},
	mounted: function () {
		this.getList(0)
	},
	methods: {
		getList: function (skip) {

			this.$http.get('/m/suggest/skip/' + (this.page + skip - 1) * this.limit + '/limit/' + this.limit ).then(function (res) {
				console.log(res.data)
				if (res.data.code == 100) {
					this.list = res.data.data.list
					this.page += skip
				} else if(res.data.code == 112) {
					alert('最后一页了')
				} else {
					alert(res.data.msg)
				}
			})
		},
		replySuggest: function (index) {
			var sug = this.list[index]
			this.$http.put('/m/suggest/id/' + sug._id, {reply: sug.reply}).then(function (res) {
				if (res.data.code == 100) {
					sug.status = 1
					alert('修改成功')
				} else {
					alert(res.data.msg)
				}
			})
		}
	}

})




</script>
</body>
</html>